// 文件上传相关API
window.uploadAPI = {
    // 上传头像
    uploadAvatar: async (file) => {
        try {
            const formData = new FormData();
            formData.append('file', file);
            
            const response = await apiClient.post('/api/upload/avatar', formData, {
                headers: {
                    'Content-Type': 'multipart/form-data'
                }
            });
            return response;
        } catch (error) {
            console.error('上传头像失败:', error);
            throw error;
        }
    },

    // 上传文档
    uploadDocument: async (file) => {
        try {
            const formData = new FormData();
            formData.append('file', file);
            
            const response = await apiClient.post('/api/upload/document', formData, {
                headers: {
                    'Content-Type': 'multipart/form-data'
                }
            });
            return response;
        } catch (error) {
            console.error('上传文档失败:', error);
            throw error;
        }
    }
};
